import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

import createPersistedstate from 'vuex-persistedstate'
//用户模块
import user from './modules/user.js'
const store = new Vuex.Store({
	modules: {
		user
	},
	plugins: [
		createPersistedstate({
			storage: { //存储方式定义
				getItem: (key) => uni.getStorageSync(key), //获取
				setItem: (key, value) => uni.setStorageSync(key, value), //设置
				removeItem: (key) => uni.removeStorageSync(key) //删除
			}
		})
	]
})

export default store;